package com.livegoods.commons.pojo;

import lombok.Data;

import java.io.Serializable;

@Data
public class LivegoodsResult  {

    private int status; //逻辑状态码  200 成功  500 程序内部出错
    private String msg;
    private Object data;
    private Object results;

    private boolean hasMore;//分页时候判断是否还有数据 true：可以继续分页，false: 已经最后一页，前端不用分页了

    public static LivegoodsResult ok(){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(200);
        result.setMsg("ok");
        return result;
    }

    public static LivegoodsResult ok(Object data){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(200);
        result.setMsg("ok");
        result.setData(data);
        return result;
    }

    public static LivegoodsResult error(String msg){
        LivegoodsResult result = new LivegoodsResult();
        result.setStatus(500);
        result.setMsg(msg);
        return result;
    }
}